package com.hz.copyingsystem.service.impl;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hz.common.utils.PageUtils;
import com.hz.common.utils.Query;

import com.hz.copyingsystem.dao.CopyingSteleCalligraphyDao;
import com.hz.copyingsystem.entity.CopyingSteleCalligraphyEntity;
import com.hz.copyingsystem.service.CopyingSteleCalligraphyService;


@Service("copyingSteleCalligraphyService")
public class CopyingSteleCalligraphyServiceImpl extends ServiceImpl<CopyingSteleCalligraphyDao, CopyingSteleCalligraphyEntity> implements CopyingSteleCalligraphyService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<CopyingSteleCalligraphyEntity> page = this.page(
                new Query<CopyingSteleCalligraphyEntity>().getPage(params),
                new QueryWrapper<CopyingSteleCalligraphyEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<CopyingSteleCalligraphyEntity> querySteleCalligraphyByIds(Integer curPage, Integer pageSize, Long yid, Long sid, Long cid, String condition) {
        curPage = (curPage-1) * pageSize;
        return this.baseMapper.querySteleCalligraphyByIds(curPage, pageSize, yid, sid, cid, condition);
    }

    /**
     * 获取总记录数
     * @return
     */
    @Override
    public Integer querySteleCalligraphyNumByIds(Long yid, Long sid, Long cid, String condition) {
        return this.baseMapper.querySteleCalligraphyNumByIds(yid, sid, cid, condition);
    }

}